
#ifndef FOUNDATION_CCRUNTIME_JSAPI_WORKER_MESSAGE_QUEUE_H
#define FOUNDATION_CCRUNTIME_JSAPI_WORKER_MESSAGE_QUEUE_H

#include <queue>

using MessageDataType = void *;
class MessageQueue final {
  public:
    void EnQueue(MessageDataType data);
    bool DeQueue(MessageDataType *data);
    bool IsEmpty() const;
    size_t GetSize() const {
        return queue_.size();
    }

  private:
    std::queue<MessageDataType> queue_;
};
#endif // FOUNDATION_CCRUNTIME_JSAPI_WORKER_MESSAGE_QUEUE_H
